home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / plot.dxr / 00087_Ampli.ls < prev    next >
Encoding:
Text File  |  2000-08-01  |  1.8 KB  |  51 lines

  1. on mouseDown me
  2.   set T0 to the top of sprite 16 - 2
  3.   set B0 to the bottom of sprite 16
  4.   set the floatPrecision to 1
  5.   set the cursor of sprite the spriteNum of me to [member "Closed Hand", member "Closed Hand Mask"]
  6.   repeat while the stillDown
  7.     if (the mouseV > T0) and (the mouseV < B0) then
  8.       set the locV of sprite 17 to the mouseV
  9.       put -5 + float((B0 - the locV of sprite 17) / 41.89999999999999858) into field "A"
  10.     end if
  11.     updateStage()
  12.   end repeat
  13. end
  14.  
  15. on mouseUp me
  16.   set the trails of sprite 19 to 1
  17.   set the cursor of sprite the spriteNum of me to [member "Hand", member "Hand Mask"]
  18.   set x0 to the locH of sprite 12
  19.   set y0 to the locV of sprite 12
  20.   if the foreColor of sprite 19 >= 6 then
  21.     set the foreColor of sprite 19 to 0
  22.   else
  23.     set the foreColor of sprite 19 to the foreColor of sprite 19 + 1
  24.   end if
  25.   updateStage()
  26.   repeat with n = 0 to 120
  27.     set the locH of sprite 19 to (2.39999999999999991 * n) + x0
  28.     if the hilite of cast "Sine" then
  29.       set the locV of sprite 19 to y0 - (field "A" * 50.0 * float(sin(float(n * 3.0 * PI / 180.0))))
  30.     end if
  31.     if the hilite of cast "Cosine" then
  32.       set the locV of sprite 19 to y0 - (field "A" * 50.0 * float(cos(float(n * 3.0 * PI / 180.0))))
  33.     end if
  34.     if the hilite of cast "Tangent" then
  35.       set the locV of sprite 19 to y0 - (field "A" * 50.0 * float(tan(float(n * 3.0 * PI / 180.0))))
  36.     end if
  37.     updateStage()
  38.   end repeat
  39.   set the locV of sprite 19 to 900
  40. end
  41.  
  42. on beginSprite
  43.   put "1" into field "A"
  44.   set the foreColor of sprite 19 to 3
  45.   set the cursor of sprite 17 to [321, 322]
  46.   set the locV of sprite 17 to the bottom of sprite 16 - (42 * 5) - 42
  47.   set the hilite of cast "Sine" to 1
  48.   set the hilite of cast "Cosine" to 0
  49.   set the hilite of cast "Tangent" to 0
  50. end
  51.